package com.heima.admin.controller;


import com.heima.admin.entity.AdUserLogin;
import com.heima.admin.service.AdUserService;
import com.heima.common.dtos.ResponseResult;
import com.heima.model.admin.dtos.AdUserLoginDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Map;

/**
 * <p>
 * 管理员登录行为信息表 前端控制器
 * </p>
 *
 * @author HM
 * @since 2021-03-31
 */
@RestController
@RequestMapping("/login")
public class AdUserLoginController {

    @Autowired
    private AdUserService adUserService;
    /**
     * @Author: fuzihang
     * @Date: 20:38 2021/4/1
     * @Parms ADMIN 登录管理平台
    */

    @PostMapping("/in")
    public ResponseResult<Map<String,String>> login(@RequestBody @Valid AdUserLoginDto dto){

        return  ResponseResult.ok(adUserService.login(dto));
    }

}

